import java.util.ArrayList;

class BoundedArrayListTest
{
	public static void main(String[] args)
	{
		ConsoleReader cr = new ConsoleReader();
		BoundedArrayList<String> al;
		int k, l;
		
		System.out.print("k (maximum)? "); k = cr.readInt();
		System.out.print("l (count)? "); l = cr.readInt();
		al = new BoundedArrayList<String>(k);
		
		try
		{
			for (int i=0; i<=l; i++)
				al.add("String #"+i);
			System.out.println("Remplissage termine avec succes");
		}
		catch (BoundOutreachedException e)
		{
			System.out.println("Echec du remplissage: borne depassee");
		}
	}
}
